small refactor to fib.cpp