NX-390: various refactorings for OSGi