Addressing some review comments on duplicated code