move functions to use params