refactor camel behavior class

This is a more robust, object oriented code. The exact same behavior.