Refactor for a more general purpose app

Turns the code a lot more general purpose. :neckbeard: