beautified the code