restructure code based on latest code base