Initial refactoring

I can assure you none of this works. :stuck_out_tongue: