clean logic & formatting