transformed to a more Ruby style