clean up and creation of session class