refactor. gah