refactoring repository code
added CRUD operations