make compatible with express 4.x + clean up