Refactoring the portal