Changed count() behavior: now an excption will be thrown if capabilities

isn't supported

Moved some methods in order to group them logically