refactor with greater de-coupling