clean code and remove unneeded checks