refactory: make code more simple