Enable sorting, enable LIKE searches and a little refactoring