Refactor, move name check