Move declarations closer to usage and change assignments to cascading style