1.99.3: Refractored version