Move some functions into actions model