Removing unneeded files and passing query parameters to respective pages