Gravar-mail: On refinement of generic state-based software components