Refactor z-index