Re-factor, bug fixing.