started to refactor. Combined some things to a single line