Reorganize functions.