repository and db stuff