Reorganized feature function