Beautified some parts of the code