Refactor passing data