Moved everything into a reusable library