Cleaned up library module