removed if else for less complexity