moved constants declarations outside of class. Better checking on onversion functions.