cleanup and small fixes