style: make some helper functions static