Omitted all private variables and added static function

Since the state variables are all used in one member function, it is
unnecessary to make them private (and no need to have member
initialization list!). So, instead, used static function.