removed code redundancies like a boss