Legacy code. Should be deleted.