cleaned up code furhter