Renamning some functions, and further work on stage class.