Code review / refactoring