Refactoring going on. Trying to turn all of this into reusable components