slight improvements and cleanup