Reorganize code in a better folder hierarchy