optimising stuff, made db more robust, generalised content