Refactors User.find_by_code