Refactor refactor refactor

No changes to functionality yet
Recfactor #2