Intermediate code for main app