changed to lib model;
added extend functionality;