cleaning up code, redundancies