Clearnup + Refactoring

Almost happy with the code