Refactored library to fix paths