Simplifying factory code for HHVM compat