rename methods to make them more clear and private
move related functions closer together
PR feedback