Fix test
Pull out method for testing