Added tests and do refactoring