Major refactoring for composer support.