Lots of repetitive code in this file from here onwards. Please modify to match the way it's done in: https://github.com/aviator/aviator/pull/54/files#L17R109