cleaned up conditionals and explicit returns