move some functions out of utils into class (no namespace asyet)