refactoring to use doubles