Style modifications
Reorganised code