Refactoring and documentation issues