Adaptations to use MBean as library