completed - now looking to refactor