reoder code and follow style guide