Updated to v2.0.0, refactored code