moved extra code from models to helpers