basic implementation of generic functions