cleaned up code and consolidated