Implementation of data access layer.