Completed A-CodeQuality
Refactored code for better abstraction.
Also fixed Assertion bug from previous release that made wrong assert call when index is within range.
Refactored code for better abstraction.
Also fixed Assertion bug from previous release that made wrong assert call when index is within range.