Restructure code.