taking out some functions from sp class that can be use in all mode