move BorderAlgo to own file, use enum only for config