make functions static where possible