Constructor and parsing