further utilized complete filter to reduce the amount of code