Clean up the code and sort methods in classes