bugs, refactor