Cleaned up library builder