Refactor code to reflect style guidelines