major cleanup (things got a little too complex)