major cleanup, overhaul for 2.7.0, removed bunk template
(cherry picked from commit 3797c9c6c74a91a09f16b39cfb88b79efa0b49a5)