refactor
todo: move to top