More elegant solution