added extractSingle (need to refactor the duplication)