It's copied and modified from the original code. But I'll remove them since they are not used anymore.