performance & minor modifications