added flog to refactor ruby