Code refine deleting extra functions