removed ugly if statement