build functions for extracting swe