Added support for general molecules. Cleanup