reorgonize code