Refine SNEP code