Database sorted out