Refactored refresh method
Added basic unittest for alive transaction