more refactoring to support 1.2 spec