Refactor border