Tidied up code on admin page