Move one function to class, try to use more object oriented style later