Updated to only use a single synchronized method and to remove duplication

This fixes #4158