refactor to reduce overall lines