remove uneeded if block