some code cleanups have been applied