[WIP] refactor some