some refactoring on the fibonacci example