add transparency to hidden border
refactoring