refactor encodeEan method to reduce length
remove some variables from build method