minor changes to cleanup code