Fix functions order