Extract methods.
Bug fix.