re-structure code formatting