Refactoring of file beam.ml.