Simplify the code a little