made code a bit neater.