updating express to v4+
consolidating some of the code