Small refactoring of sensors plugin