improved debugging / events / core architecture