add ace files - refactor chat code a bit