Did some refactoring. todo: -serverside tostringpattern validation doesn't
seem to work. -have to add some translations