Move prop creation to seperate function