Refactoring private and public methods