Extracted templates in the client

Extracted the templates for the pages and other constants. Did some
refactoring.