Splited whole process into methods.