V1.0.0/2149

Seems the same implementation with this part po, can we create function to handle this so that it will not be repeated po :bow: 

https://github.com/sarahgosago/book-management-system/pull/54/files#diff-61d402a0a1b1f7c9e74f01fe105bc5f6R199