Added compile spec
Separated common and application layout logic