Changed derivation logic to use method_exists as it is slightly faster @neerolyte + updated tests