Refactored some methods on the library classes