Use fail instead of raise to signal exceptions
Remove redundant curly braces around hash parameters
Remove redundant returns