cleanup and small fix