diff --git a/TestON/tests/PingallExample/PingallExample.py b/TestON/tests/PingallExample/PingallExample.py
index faf374f..2798a97 100644
--- a/TestON/tests/PingallExample/PingallExample.py
+++ b/TestON/tests/PingallExample/PingallExample.py
@@ -8,10 +8,10 @@
 """
 class PingallExample:
 
-    def __init__( self ) :
+    def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ) :
+    def CASE1( self, main ):
         """
            CASE1 is to compile ONOS and push it to the test machines
 
@@ -29,73 +29,73 @@
         main.case( "Setting up test environment" )
 
         # load some vairables from the params file
-        PULL_CODE = False
+        PULLCODE = False
         if main.params[ 'Git' ] == 'True':
-            PULL_CODE = True
-        cell_name = main.params[ 'ENV' ][ 'cellName' ]
+            PULLCODE = True
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
 
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
         main.step( "Applying cell variable to environment" )
-        cell_result = main.ONOSbench.set_cell( cell_name )
-        verify_result = main.ONOSbench.verify_cell()
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
 
         main.log.report( "Uninstalling ONOS" )
-        main.ONOSbench.onos_uninstall( ONOS1_ip )
+        main.ONOSbench.onosUninstall( ONOS1Ip )
 
-        clean_install_result = main.TRUE
-        git_pull_result = main.TRUE
+        cleanInstallResult = main.TRUE
+        gitPullResult = main.TRUE
 
         main.step( "Compiling the latest version of ONOS" )
-        if PULL_CODE:
+        if PULLCODE:
             main.step( "Git checkout and pull master" )
-            main.ONOSbench.git_checkout( "master" )
-            git_pull_result = main.ONOSbench.git_pull()
+            main.ONOSbench.gitCheckout( "master" )
+            gitPullResult = main.ONOSbench.gitPull()
 
             main.step( "Using mvn clean & install" )
-            clean_install_result = main.TRUE
-            if git_pull_result == main.TRUE:
-                clean_install_result = main.ONOSbench.clean_install()
+            cleanInstallResult = main.TRUE
+            if gitPullResult == main.TRUE:
+                cleanInstallResult = main.ONOSbench.cleanInstall()
             else:
                 main.log.warn( "Did not pull new code so skipping mvn " +
                                "clean install" )
-        main.ONOSbench.get_version( report=True )
+        main.ONOSbench.getVersion( report=True )
 
-        cell_result = main.ONOSbench.set_cell( cell_name )
-        verify_result = main.ONOSbench.verify_cell()
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
         main.step( "Creating ONOS package" )
-        package_result = main.ONOSbench.onos_package()
+        packageResult = main.ONOSbench.onosPackage()
 
         main.step( "Installing ONOS package" )
-        onos1_install_result = main.ONOSbench.onos_install( options="-f",
-                                                            node=ONOS1_ip )
+        onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                           node=ONOS1Ip )
 
         main.step( "Checking if ONOS is up yet" )
         for i in range( 2 ):
-            onos1_isup = main.ONOSbench.isup( ONOS1_ip )
-            if onos1_isup:
+            onos1Isup = main.ONOSbench.isup( ONOS1Ip )
+            if onos1Isup:
                 break
-        if not onos1_isup:
+        if not onos1Isup:
             main.log.report( "ONOS1 didn't start!" )
 
         # TODO: if it becomes an issue, we can retry this step  a few times
 
-        cli_result = main.ONOScli1.start_onos_cli( ONOS1_ip )
+        cliResult = main.ONOScli1.startOnosCli( ONOS1Ip )
 
-        case1_result = ( clean_install_result and package_result and
-                         cell_result and verify_result and
-                         onos1_install_result and
-                         onos1_isup and cli_result )
+        case1Result = ( cleanInstallResult and packageResult and
+                        cellResult and verifyResult and
+                        onos1InstallResult and
+                        onos1Isup and cliResult )
 
-        utilities.assert_equals( expect=main.TRUE, actual=case1_result,
-                                 onpass="Test startup successful",
-                                 onfail="Test startup NOT successful" )
+        utilities.assert_equals( expect=main.TRUE, actual=case1Result,
+                                onpass="Test startup successful",
+                                onfail="Test startup NOT successful" )
 
-        if case1_result == main.FALSE:
+        if case1Result == main.FALSE:
             main.cleanup()
             main.exit()
 
-    def CASE2( self, main ) :
+    def CASE2( self, main ):
         """
            Assign mastership to controller
         """
@@ -105,35 +105,35 @@
         main.case( "Assigning Controller" )
         main.step( "Assign switches to controller" )
 
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS1_port = main.params[ 'CTRL' ][ 'port1' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
 
         for i in range( 1, 14 ):
-            main.Mininet1.assign_sw_controller(
+            main.Mininet1.assignSwController(
                 sw=str( i ),
-                ip1=ONOS1_ip,
-                port1=ONOS1_port )
+                ip1=ONOS1Ip,
+                port1=ONOS1Port )
 
-        mastership_check = main.TRUE
+        mastershipCheck = main.TRUE
         for i in range( 1, 14 ):
-            response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+            response = main.Mininet1.getSwController( "s" + str( i ) )
             try:
                 main.log.info( str( response ) )
             except:
                 main.log.info( repr( response ) )
-            if re.search( "tcp:" + ONOS1_ip, response ):
-                mastership_check = mastership_check and main.TRUE
+            if re.search( "tcp:" + ONOS1Ip, response ):
+                mastershipCheck = mastershipCheck and main.TRUE
             else:
-                mastership_check = main.FALSE
-        if mastership_check == main.TRUE:
+                mastershipCheck = main.FALSE
+        if mastershipCheck == main.TRUE:
             main.log.report( "Switch mastership assigned correctly" )
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=mastership_check,
+            actual=mastershipCheck,
             onpass="Switch mastership assigned correctly",
             onfail="Switches not assigned correctly to controllers" )
 
-    def CASE3( self, main ) :
+    def CASE3( self, main ):
         """
            Assign intents
         """
@@ -144,19 +144,19 @@
 
         # install onos-app-fwd
         main.log.info( "Install reactive forwarding app" )
-        main.ONOScli1.feature_install( "onos-app-fwd" )
+        main.ONOScli1.featureInstall( "onos-app-fwd" )
 
         # REACTIVE FWD test
-        ping_result = main.FALSE
+        pingResult = main.FALSE
         time1 = time.time()
-        ping_result = main.Mininet1.pingall()
+        pingResult = main.Mininet1.pingall()
         time2 = time.time()
         main.log.info( "Time for pingall: %2f seconds" % ( time2 - time1 ) )
 
         # uninstall onos-app-fwd
         main.log.info( "Uninstall reactive forwarding app" )
-        main.ONOScli1.feature_uninstall( "onos-app-fwd" )
+        main.ONOScli1.featureUninstall( "onos-app-fwd" )
 
-        utilities.assert_equals( expect=main.TRUE, actual=ping_result,
-                                 onpass="All hosts are reachable",
-                                 onfail="Some pings failed" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                onpass="All hosts are reachable",
+                                onfail="Some pings failed" )
