refactor quite a bit