move code around for aesthetics