Refactor big time