made a new class for background calculation to avoid duplicate functions