WIP: refactor.