struggling with library design