refactor the get-docblock-for-function code