Change actions to functions