refactoring to maybe