OK, few hints how to make it shorter and better readable
- create method ptp? which decide replace is_ptp variable and all related code
- move just_address_contents to own method and use better name and if it still long, then all types to own methods
- move label to own method and rename it for better name like address_label