Fix paginator bug and refactor search block