almost ready to remove some obsecure code