level up the code logic