Refactored Work and Book class to encapsulate functionality