refactor doubles