Refactored to use polymorphic code style
Updated to version 1.1