use typealias and reformat code