fixes and cleanup