cosmetic modifications, removed redundant checks