refactor redundancy