move misc functions to class file