optimise model and add setAccount funtion