TODO: a better solution