Simplify library and test cases