Code refactor. Remove redundant methods and more public methods to the top.