refactor, indentation, comments