Slightly better solution to multiple editing problem with layer index