Better exception handling, refactored page loading