refactoring for better hhvm compatibility