reorganize code..