moved functions to separate classes