Code quality - fix overly strong type cast
Update target platform to 17
Remove some comments
Replace missing code