refactor index and filter controllers