Cleaning and changing to new coding style