Replaced ServiceTracker by Declarative Service references

fixes #228
Fixing invalid if-clause

fixes #227