Reshuffle code a little