Refactored library tests