Improvements on database access & minor addings