not found handling refactored