Reworking scanner service code