simplier implementation using only one parse and optional parts
removed commented out code