fib: make the codes more concise