Removing white space and refactor