better way of dealing with pages