factor out unnecessary variable