refactor page title functionality, modify tests