Refactor sqlformatter [wip]