Reorganize code a bit
WIP