Fix for pages being escaped incorrectly
Code clean up

https://www.pivotaltracker.com/story/show/66829192