Use string interpolation and replace deprecated methods