Refactor to remove scope from controller