Clean up FunctionBuilder code

- Smaller methods
- Better names