Removes unnecessary logic to simplify the code