Refactored the library.js file into multiple model and view files