move addressing mode logic to new class