Fix #8: Change internal data representation to function