Simplified the code a bit by using Duke utility class.