refactors out unneccesary vars