Refactor with doubles