Code review, refactoring and documentation