fixes, improvements and clean up