Refactor border.h