refoctored some methods