end of day refactoring
pulled from origin