Make some code a bit more elegant