Refactor index route for getting and binding data