Converted statics to enums

Making use of the enums feature provided in newer versions of Java
Using lambdas

Converted some anonymous class usage into lambdas.