refactoring, style edits