reorganize code structure a bit
missed some things