Functional but dirty spagetti codE