New function: dot
Refactoring: move helper functions to util module