Made mapping more generic