Refactored and Added tests

.... Testing per method does not make much sense since the function of most of the methods are extremely coupled