Clean code with if/while let