refactor and DRY UP specs clean up code