minor performance imporovements