not sure if this refactor makes it better...