moved lib to models