Renamed function to make it multifunctional