Simplify a few lines of code