merge from internal repo finished: flash instance passed through modules and minor improvements