moved lib into app/models