More elegant solution?