1) fix border color issues 2) code refactoring