Factor out reusable libraries