Optimise code a little bit