Restructure code. Add indent preservation