seperate func to make code clean