moved method into model