Moved common code for virtual sensors to abstract class