Feature/reorganize code