Restructure code base