refactoring and add spec at background