Refactor for express 4 upgrade