Reflect from borders.
Use struct instead of record for perf reasons.
Minor refactoring.