Change params
Move common funcs at module level