add and reorganize code base