Refactor using ProMotion

This turns a bunch of crappy code into a few lines of pretty code.