Some refactoring, getting rid of string dependencies and also fixing some pagination buggs.