make compatible with express 4.x + clean up

Please review.