more refactoring
refactoring to remove complexity