Refactor Register