404 handling and refactoring haml