refactoring shelf and book classes