Minor code style changes, re-organization