Constructor and config functions.