Removing conditional from function definition