refactor complete, i think