Refactor

this won't work for HHVM