changed how composition is parsed

This change made the compiled code faster (26%, in some cases I tried)
cleaned up