Changed functions to methods