Refactor PageClassResolver to do much interesting job