Trying to simplify some code.