Reorganization: split main up into directives and separate views