optimize database related gradle structure