Restructure a bit to be more readable