Making it compatible with ADVPL and refactored the class with protected
methods, and refactored tests to use only public API.