Should really put the lib folder in app
swapped to instances and static functions to stop having to pass variables all over the palce