Cleanup and Comments

Added comments to PrimitiveFactory and App