functions to methods