removed ugly code