refactor into working OSGI services