refactored behavior and added compatibility fix for publishable behavior