restructure code base