code formatting & cleanup