got refactor working