removed some unnecessary logic