WIP: fix style
WIP: move the code around, where it belongs