Type Safety

Add type safety to get rid of warnings.
Upgrade deprecated maven expressions

to property
fix type safety issues too