preamble operation
refactoring: localize variable
refactoring: split preamble process