refactored
Fully refactored, see +def +new
changes to normalize