big time refactor