Refactored for release 1.0b