SamanA - removed inefficient regex parsing and used encodings