Style and refactor