Restructuring the functions with overloading