Removed redundent methods
add some unit tests