Added duplicated code for test purposal