seems like a complex if statement and hard to read... can you refactor this into just a normal if statement?