Adding test cases and refactored duplicate code.
Merge branch 'workstationRefactor'