Refactor link method for CustomPages