Refactored according to style guide