i think refactor all this at commands into a seperate function.