refactored 5pm friday
further refactoring