minor refactoring
Merge branch 'master' into spa

Conflicts:
	middleware/index.js