Added layout links tests and refactoring