Extracted functions into class.