got rid of redundant if-statement