Ecency
internal functions