Refactored library structure