Refactor core for better error handling