restructure source
remove some temp code