Converting page template into class