more serialization implementation

`count` is overkill here (O(n) runtime instead of O(1)) since you don't need the actual number, all you need to know is `if ( empty( $sorts ) )`.