Fixed deprecated function and added a thematic best practice

neither causeed errors, just keeping it modern